//package com.info.zhiduoduo.admin.controller;
//
//import com.info.zhiduoduo.admin.model.formbean.company.CompanyListFormBean;
//import com.info.zhiduoduo.admin.model.formbean.company.PartnerMakerDetailListFormBean;
//import com.info.zhiduoduo.admin.model.formbean.crm.PartnerKpiDataFormBean;
//import com.info.zhiduoduo.admin.model.formbean.partner.*;
//import com.info.zhiduoduo.admin.model.vo.partner.PartnerKpiDataVO;
//import com.info.zhiduoduo.admin.model.vo.partner.WriteOffBrokerageVO;
//import com.info.zhiduoduo.admin.service.PartnerService;
//import com.info.zhiduoduo.common.annotation.LogEntity;
//import com.info.zhiduoduo.common.annotation.LogParameter;
//import com.info.zhiduoduo.common.annotation.ZddLog;
//import com.info.zhiduoduo.common.constants.SmartResult;
//import com.info.zhiduoduo.common.constants.system.ZddLogType;
//import com.info.zhiduoduo.common.formbean.BaseSimpleFormBean;
//import com.info.zhiduoduo.core.formbean.ListPartnerStudioWithdrawsFromBean;
//import com.info.zhiduoduo.core.service.CorePartnerService;
//import com.info.zhiduoduo.repository.dto.partner.PartnerBriefDto;
//import com.info.zhiduoduo.repository.dto.partner.PartnerCompanyExpireDto;
//import com.info.zhiduoduo.repository.dto.partner.PartnerExpireDto;
//import com.info.zhiduoduo.repository.dto.partner.PartnerMakerDetailDto;
//import com.info.zhiduoduo.repository.dto.partner.PartnerMakerExpireDto;
//import com.info.zhiduoduo.repository.dto.partner.PartnerStudioWithdrawDto;
//import com.info.zhiduoduo.repository.dto.partner.PartnerSubDto;
//import com.info.zhiduoduo.repository.entity.partner.Partner;
//import com.info.zhiduoduo.repository.entity.partner.PartnerAccount;
//import com.info.zhiduoduo.repository.entity.partner.PartnerBrokerage;
//import com.info.zhiduoduo.repository.entity.partner.PartnerCompany;
//import com.info.zhiduoduo.repository.entity.partner.PartnerMaker;
//import com.info.zhiduoduo.repository.entity.partner.PartnerSub;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestParam;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.Date;
//import java.util.List;
//
//import javax.servlet.http.HttpServletResponse;
//import javax.validation.Valid;
//
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//
//@Api(tags = "合伙人接口")
//@RestController
//@RequestMapping("/partner")
//public class PartnerController {
//
//	@Autowired
//	PartnerService partnerService;
//	@Autowired
//	CorePartnerService corePartnerService;
//
//	@ApiOperation("获取合伙人列表（根据状态）")
//	@PostMapping("/verifyingPartnerList")
//	public SmartResult<PartnerBriefDto> getVerifyingPartnerList(@RequestBody BaseSimpleFormBean<PartnerListFormBean> formBean) {
//		return partnerService.getVerifyingPartnerList(formBean);
//	}
//
//	@ApiOperation("获取所有上线企业")
//	@PostMapping("/goOnlineCompanyList")
//	public SmartResult getGoOnlineCompanyList(@RequestBody BaseSimpleFormBean<CompanyListFormBean> formBean) {
//		return partnerService.getGoOnlineCompanyList(formBean);
//	}
//
//	@ApiOperation("获取企业与合伙人设置关系")
//	@PostMapping("/getCompanyPartnerList")
//	public SmartResult getCompanyPartnerList(@RequestBody BaseSimpleFormBean<Integer> formBean){
//		return partnerService.getCompanyPartnerList(formBean);
//	}
//
//	@ZddLog(name = "新增企业与合伙人关系")
//	@ApiOperation("新增企业与合伙人关系")
//	@PostMapping("/savePartnerCompany")
//	public SmartResult savePartnerCompany(@Valid @RequestBody BaseSimpleFormBean<SavePartnerCompanyFormBean> formBean) {
//		return partnerService.savePartnerCompany(formBean);
//	}
//
//	@ZddLog(type = ZddLogType.DELETE,name = "删除合伙人与企业的关系（逻辑删除）",entities = @LogEntity(entity = PartnerCompany.class,parameters =
//	@LogParameter(fields = "id",parameters = "formBean.reqdata.id")))
//	@ApiOperation("删除合伙人与企业的关系（逻辑删除）")
//	@PostMapping("/deletePartnerCompany")
//	public SmartResult deletePartnerCompany(@RequestBody BaseSimpleFormBean<DeletePartnerCompanyFormBean> formBean) {
//		return partnerService.deletePartnerCompany(formBean);
//	}
//
//	@ApiOperation("新增创客与合伙人关系")
//	@PostMapping("/savePartnerMaker")
//	public SmartResult savePartnerMaker(@Valid @RequestBody BaseSimpleFormBean<SavePartnerMakerFormBean> formBean) {
//		return partnerService.savePartnerMaker(formBean);
//	}
//
//	@ZddLog(type = ZddLogType.DELETE,name = "删除合伙人与创客的关系（逻辑删除）",entities = @LogEntity(entity = PartnerMaker.class,parameters =
//	@LogParameter(fields = "id",parameters = "formBean.reqdata.id")))
//	@ApiOperation("删除合伙人与创客的关系（逻辑删除）")
//	@PostMapping("/deletePartnerMaker")
//	public SmartResult deletePartnerMaker(@RequestBody BaseSimpleFormBean<DeletePartnerMakerFormBean> formBean) {
//		return partnerService.deletePartnerMaker(formBean);
//	}
//
//	@ApiOperation("获取合伙人创客列表")
//	@PostMapping("/listPartnerMakers")
//	public SmartResult<PartnerMakerDetailDto> listPartnerMakerDetails(
//			@RequestBody BaseSimpleFormBean<PartnerMakerDetailListFormBean> formBean) {
//		return partnerService.listPartnerMakerDetails(formBean);
//	}
//
//	@ApiOperation("获取所有的合伙人")
//	@PostMapping("/allCertifiedPartner")
//	public SmartResult getAllCertifiedPartner(@RequestBody BaseSimpleFormBean formBean) {
//		return partnerService.getAllCertifiedPartner(formBean);
//	}
//
//	@ZddLog(type = ZddLogType.UPDATE,name = "修改partner审核状态",entities = @LogEntity(entity = PartnerAccount.class,parameters =
//	@LogParameter(fields = "partnerid",parameters = "formBean.reqdata.partnerid")))
//	@ApiOperation("修改partner审核状态")
//	@PostMapping("/changeState")
//	public SmartResult changePartnerState(@RequestBody BaseSimpleFormBean<ChangePartnerStateFormBean> formBean) {
//		return partnerService.changeState(formBean);
//	}
//
//	@ZddLog(type = ZddLogType.UPDATE,name = "合伙人实名认证",entities = @LogEntity(entity = PartnerAccount.class,parameters =
//	@LogParameter(fields = "acctid",parameters = "formBean.reqdata.acctid")))
//	@ApiOperation("合伙人实名认证")
//	@PostMapping("/verifyPartnerAccount")
//	public SmartResult verifyPartnerAccount(@RequestBody BaseSimpleFormBean<VerifyPartnerFormBean> formBean) {
//		return partnerService.verifyPartnerAccount(formBean);
//	}
//
//	@ZddLog(name = "新增合伙人佣金记录")
//	@ApiOperation("新增合伙人佣金记录")
//	@PostMapping("/savePartnerBrokerage")
//	public SmartResult savePartnerBrokerage(@RequestBody @Valid BaseSimpleFormBean<SavePartnerCommissionRecordFormBean> formBean) {
//		return partnerService.savePartnerBrokerage(formBean);
//	}
//
//	@ApiOperation("查询所有佣金记录")
//	@PostMapping("/getAllCommissionRecord")
//	public SmartResult getAllCommissionRecord(@RequestBody BaseSimpleFormBean<PartnerBrokerageListFormBean> formBean) {
//		return partnerService.getAllCommissionRecord(formBean);
//	}
//
//	@ApiOperation("下载所有佣金记录")
//	@GetMapping("/downloadCommissionRecord")
//	public void downloadCommissionRecord(HttpServletResponse response, @RequestParam("startDate") String startDate,
//	                                     @RequestParam("endDate") String endDate,
//	                                     @RequestParam(value = "name", required = false, defaultValue = "") String name,
//	                                     @RequestParam(value = "state", required = false, defaultValue = "0") int state,
//	                                     @RequestParam(value = "partnerType", required = false, defaultValue = "0") int partnerType,
//	                                     @RequestParam(value = "partnerAccountType", required = false, defaultValue = "0") int partnerAccountType) {
//		partnerService.downloadCommissionRecord(response, startDate, endDate, name, state, partnerType, partnerAccountType);
//	}
//
//	@ApiOperation("获取合伙人详细信息")
//	@PostMapping("/getPartnerInfo")
//	public SmartResult getPartnerInfo(@RequestBody BaseSimpleFormBean<GetPartnerInfoFormBean> formBean) {
//		return partnerService.getPartnerInfo(formBean);
//	}
//
//	@ZddLog(type = ZddLogType.UPDATE,name = "编辑合伙人实名信息",entities = @LogEntity(entity = PartnerAccount.class,parameters =
//	@LogParameter(fields = "partnerid",parameters = "formBean.reqdata.partnerid")))
//	@ApiOperation("编辑合伙人实名信息")
//	@PostMapping("/updatePartnerAccount")
//	public SmartResult updatePartnerAccount(@Valid @RequestBody BaseSimpleFormBean<UpdatePartnerAccountFormBean> formBean) {
//		return partnerService.updatePartnerAccount(formBean);
//	}
//
//	@ZddLog(type = ZddLogType.DELETE,name = "删除合伙人（物理删除）",entities = @LogEntity(entity = PartnerBrokerage.class,parameters =
//	@LogParameter(fields = "partnerid",parameters = "formBean.reqdata")))
//	@ApiOperation("删除合伙人(物理删除)")
//	@PostMapping("/delPartner")
//	public SmartResult delPartner(@RequestBody BaseSimpleFormBean<Integer> formBean) {
//		return partnerService.delPartner(formBean);
//	}
//
//	@ZddLog(type = ZddLogType.UPDATE,name = "修改邀请码",entities = @LogEntity(entity = Partner.class,parameters =
//	@LogParameter(fields = "partnerid",parameters = "formBean.reqdata.partnerid")))
//	@ApiOperation("修改邀请码")
//	@PostMapping("/editInviteCode")
//	public SmartResult editInviteCode(@RequestBody BaseSimpleFormBean<EditInviteCodeFormBean> formBean) {
//		return partnerService.editInviteCode(formBean);
//	}
//
//	@ApiOperation("获取合同中合伙人字段")
//	@PostMapping("/queryGivenField")
//	public SmartResult queryGivenField(@RequestBody BaseSimpleFormBean<GetPartnerInfoFormBean> formBean) {
//		return partnerService.queryGivenField(formBean);
//	}
//
//	@ApiOperation("获取推荐的企业列表")
//	@PostMapping("/recommendCompanyList")
//	public SmartResult getRecommendCompanyList(@RequestBody BaseSimpleFormBean<RecommendCompanyListFormBean> formBean) {
//		return partnerService.getRecommendCompanyList(formBean);
//	}
//
//	@ApiOperation("审核推荐的企业")
//	@PostMapping("/verifyRecommendCompany")
//	public SmartResult verifyRecommendCompany(@RequestBody BaseSimpleFormBean<VerifyRecommendCompanyFormBean> formBean) {
//		return partnerService.verifyRecommendCompany(formBean);
//	}
//
//	@ZddLog(name = "处理推荐的企业",entities = @LogEntity(entity = PartnerCompany.class,parameters =
//	@LogParameter(fields = "id",parameters = "formBean.reqdata.id")))
//	@ApiOperation("处理推荐的企业")
//	@PostMapping("/handleRecommendCompany")
//	public SmartResult handleRecommendCompany(@RequestBody BaseSimpleFormBean<VerifyRecommendCompanyFormBean> formBean) {
//		return partnerService.handleRecommendCompany(formBean);
//	}
//
//	@ZddLog(name = "后台新增合伙人实名信息")
//	@ApiOperation("后台新增合伙人实名信息")
//	@PostMapping("/savePartner")
//	public SmartResult savePartner(@Valid @RequestBody BaseSimpleFormBean<SavePartnerFormBean> formBean) {
//		return partnerService.savePartner(formBean);
//	}
//
//	@ZddLog(type = ZddLogType.UPDATE,name = "合伙人解约",entities = @LogEntity(entity = Partner.class,parameters =
//	@LogParameter(fields = "partnerid",parameters = "formBean.reqdata")))
//	@ApiOperation("合伙人解约")
//	@PostMapping("/partnerRescission")
//	public SmartResult partnerRescission(@RequestBody BaseSimpleFormBean<Integer> formBean) {
//		return partnerService.partnerRescission(formBean);
//	}
//
//	@ZddLog(type = ZddLogType.UPDATE,name = "合伙人续约",entities = @LogEntity(entity = PartnerAccount.class,parameters =
//	@LogParameter(fields = "partnerid",parameters = "formBean.reqdata.partnerid")))
//	@ApiOperation("合伙人续约")
//	@PostMapping("/partnerRenew")
//	public SmartResult partnerRenew(@Valid @RequestBody BaseSimpleFormBean<PartnerRenewFormbean> formBean) {
//		return partnerService.partnerRenew(formBean);
//	}
//
//	@ApiOperation("获取解约合伙人列表")
//	@PostMapping("/rescissionList")
//	public SmartResult rescissionList(@RequestBody BaseSimpleFormBean<PartnerListFormBean> formBean) {
//		return partnerService.getRescissionList(formBean);
//	}
//
//	@ApiOperation("获取二级合伙人列表")
//	@PostMapping("/subPartnerList")
//	public SmartResult<PartnerSubDto> getSubPartnerList(@RequestBody BaseSimpleFormBean<SubPartnerListFormBean> formBean) {
//		return partnerService.getSubPartnerList(formBean);
//	}
//
//	@ZddLog(name = "添加或编辑二级合伙人")
//	@ApiOperation(("添加或编辑二级合伙人"))
//	@PostMapping("/addEditSubPartner")
//	public SmartResult addEditSubPartner(@RequestBody BaseSimpleFormBean<AddEditSubPartnerFormBean> formBean) {
//		return partnerService.addEditSubPartner(formBean);
//	}
//
//	@ZddLog(type = ZddLogType.DELETE,name = "删除二级合伙人",entities = @LogEntity(entity = PartnerSub.class,parameters =
//	@LogParameter(fields = "id",parameters = "formBean.reqdata")))
//	@ApiOperation("删除二级合伙人")
//	@PostMapping("/delSubPartner")
//	public SmartResult delSubPartner(@RequestBody BaseSimpleFormBean<Integer> formBean) {
//		return partnerService.delSubPartner(formBean);
//	}
//
//	@ApiOperation("搜索可用的二级合伙人")
//	@PostMapping("/validSubPartnerList")
//	public SmartResult validSubPartnerList(@RequestBody BaseSimpleFormBean<String> formBean) {
//		return partnerService.getValidSubPartnerList(formBean);
//	}
//
//	@ApiOperation("获取合伙人绩效kpi数据")
//	@PostMapping("/partnerKpiData")
//	public SmartResult getPartnerKpiData(@RequestBody PartnerKpiDataFormBean formBean) {
//		Date month = formBean.getMonth();
//		int partnerid = formBean.getPartnerid();
//		if (month == null) month = new Date();
//
//		PartnerKpiDataVO partnerKpiData = partnerService.getPartnerKpiData(partnerid, month);
//		return SmartResult.success(partnerKpiData);
//	}
//
//	@ZddLog(name = "机构合伙人佣金销账/工作室发单模式销账")
//	@ApiOperation("机构合伙人佣金销账/工作室发单模式销账")
//	@PostMapping("/writeOffOrgPartnerBrokerage")
//	public SmartResult<WriteOffBrokerageVO> writeOffOrgPartnerBrokerage(
//			@RequestBody BaseSimpleFormBean<WriteOffPartnerBrokerageFormBean> formBean) {
//		return partnerService.writeOffOrgPartnerBrokerage(formBean);
//	}
//
//	@ZddLog(name = "众包项目合伙人佣金手动销账")
//	@ApiOperation("众包项目合伙人佣金手动销账")
//	@PostMapping("/writeOffCrowdsourcePartnerBrokerage")
//	public SmartResult<WriteOffBrokerageVO> writeOffCrowdsourcePartnerBrokerage(
//			@RequestBody BaseSimpleFormBean<List<WriteOffCrowdsourcePartnerBrokerageFormBean>> formBean) {
//		return partnerService.writeOffCrowdsourcePartnerBrokerage(formBean);
//	}
//
//	@ApiOperation("获取超过限额的合伙人列表")
//	@PostMapping("/listbrokerageExeedPartners")
//	public SmartResult<PartnerBriefDto> listBrokerageExceedPartners(@RequestBody BaseSimpleFormBean<PartnerListFormBean> formBean) {
//		return partnerService.listBrokerageExceedPartners(formBean);
//	}
//
//	@ZddLog(type = ZddLogType.UPDATE,name = "设置合伙人佣金体现类型",entities = @LogEntity(entity = PartnerAccount.class,parameters =
//	@LogParameter(fields = "partnerids",parameters = "formBean.reqdata.partnerids")))
//	@ApiOperation("设置合伙人佣金提现类型")
//	@PostMapping("/setPartnerBrokerageRemitType")
//	public SmartResult setPartnerBrokerageRemitType(@Valid @RequestBody BaseSimpleFormBean<PartnerRemitTypeFormBean> formBean) {
//		return partnerService.setPartnerBrokerageRemitType(formBean);
//	}
//
//	@ApiOperation("获取1个月内即将到期的合伙人列表")
//	@PostMapping("/listPendingExpirePartners")
//	public SmartResult<PartnerExpireDto> listPendingExpirePartners(@RequestBody BaseSimpleFormBean<PartnerListFormBean> formBean) {
//		return partnerService.listPendingExpirePartners(formBean);
//	}
//
//	@ApiOperation("获取合伙人工作室模式提现申请列表")
//	@PostMapping("/listPartnerStudioWithdraws")
//	public SmartResult<PartnerStudioWithdrawDto> listPartnerStudioWithdraws(
//			@RequestBody BaseSimpleFormBean<ListPartnerStudioWithdrawsFromBean> formBean) {
//		return corePartnerService.listPartnerStudioWithdraws(formBean);
//	}
//
//
//	@ApiOperation("下载合伙人工作室模式提现申请列表")
//	@GetMapping("/exportPartnerStudioWithdraws")
//	public void exportPartnerStudioWithdraws(HttpServletResponse response, @RequestParam(required = false) String name,
//	                                         @RequestParam(required = false, defaultValue = "0") int state,
//	                                         @RequestParam(required = false) Date from, @RequestParam(required = false) Date to) {
//		partnerService.exportPartnerStudioWithdraws(response, name, state, from, to);
//	}
//
//	@ApiOperation("获取1个月内即将到期的合伙人企业分佣列表")
//	@PostMapping("/listPendingExpirePartnerCompany")
//	public SmartResult<PartnerCompanyExpireDto> listPendingExpirePartnerCompany(@RequestBody BaseSimpleFormBean formBean) {
//		return partnerService.listPendingExpirePartnerCompany(formBean);
//	}
//
//	@ApiOperation("获取已经到期的合伙人企业分佣列表")
//	@PostMapping("/listExpiredPartnerCompany")
//	public SmartResult<PartnerCompanyExpireDto> listExpiredPartnerCompany(
//			@RequestBody BaseSimpleFormBean<ListPartnerExpiredFormBean> formBean) {
//		return partnerService.listExpiredPartnerCompany(formBean);
//	}
//
//	@ApiOperation("获取1个月内即将到期的合伙人创客分佣列表")
//	@PostMapping("/listPendingExpirePartnerMaker")
//	public SmartResult<PartnerMakerExpireDto> listPendingExpirePartnerMaker(@RequestBody BaseSimpleFormBean formBean) {
//		return partnerService.listPendingExpirePartnerMaker(formBean);
//	}
//
//	@ApiOperation("获取已经到期的合伙人企业分佣列表")
//	@PostMapping("/listExpiredPartnerMaker")
//	public SmartResult<PartnerMakerExpireDto> listExpiredPartnerMaker(
//			@RequestBody BaseSimpleFormBean<ListPartnerExpiredFormBean> formBean) {
//		return partnerService.listExpiredPartnerMaker(formBean);
//	}
//
//	@ZddLog(type = ZddLogType.UPDATE,name = "设置合伙人企业分佣状态",entities = @LogEntity(entity = PartnerCompany.class,parameters =
//	@LogParameter(fields = "id",parameters = "formBean.reqdata.id")))
//	@ApiOperation("设置合伙人企业分佣状态")
//	@PostMapping("/savePartnerCompanyState")
//	public SmartResult savePartnerCompanyState(@RequestBody BaseSimpleFormBean<SavePartnerCompanyStateFormBean> formBean) {
//		return partnerService.savePartnerCompanyState(formBean);
//	}
//
//	@ZddLog(type = ZddLogType.UPDATE,name = "设置合伙人创客分佣状态",entities = @LogEntity(entity = PartnerMaker.class,parameters =
//	@LogParameter(fields = "id",parameters = "formBean.reqdata.id")))
//	@ApiOperation("设置合伙人创客分佣状态")
//	@PostMapping("/savePartnerMakerState")
//	public SmartResult savePartnerMakerState(@RequestBody BaseSimpleFormBean<SavePartnerCompanyStateFormBean> formBean) {
//		return partnerService.savePartnerMakerState(formBean);
//	}
//
//	@GetMapping("/fixExpiredPartnerProjectBrokerage")
//	public SmartResult fixExpiredPartnerProjectBrokerage(@RequestParam String ids) {
//		return partnerService.fixExpiredPartnerProjectBrokerage(ids);
//	}
//
//	@ZddLog(type = ZddLogType.UPDATE,name = "修改合伙人实名信息中的是否为众包合伙人与众包基础费率",entities = @LogEntity(entity = PartnerAccount.class,parameters =
//	@LogParameter(fields = "partnerid",parameters = "formBean.reqdata.partnerid")))
//	@ApiOperation("修改合伙人实名信息中的是否为众包合伙人与众包基础费率")
//	@PostMapping("/updateRealNameByCrowd")
//	public SmartResult updateRealNameByCrowd(@Valid @RequestBody BaseSimpleFormBean<UpdateRealNameByCrowdFormBean> formBean) {
//		return partnerService.updateRealNameByCrowd(formBean);
//	}
//
//	@GetMapping("/fixBrokerageRemitState")
//	public SmartResult fixBrokerageRemitState() {
//		return partnerService.fixBrokerageRemitState();
//	}
//
//	@ApiOperation("批量开通/关闭抗原分销功能")
//	@PostMapping("/vaccineStatus")
//	public SmartResult vaccineStatus(@Valid @RequestBody BaseSimpleFormBean<VaccineStatusFormBean> formBean) {
//		return partnerService.vaccineStatus(formBean);
//	}
//
//	@ApiOperation("合伙人提现申请佣金销帐")
//	@PostMapping("/partnerBrokerageWriteOff")
//	public SmartResult partnerBrokerageWriteOff(@Valid @RequestBody BaseSimpleFormBean<PartnerWriteOffFormBean> formBean) {
//		return partnerService.partnerBrokerageWriteOff(formBean);
//	}
//}
